// JavaScript Document
var plug_volume = {}
plug_volume.mkVolDiv=function (){
	
	this.lockDisplay = false;
	this.idpre ='g_';
	this.cbfunctionname ;
	this.obstructNum = 0; 
	}
	
plug_volume.mkVolDiv.prototype.timeoutCallBack = function(ar){
	//console.warn(this.idpre);
	               
				  document.getElementById( this.idpre+'_volume').style.display = 'none';
				   
				  this.lockDisplay = false;
			     				 
}

plug_volume.mkVolDiv.prototype.run=function( ){
    var oDiv = document.createElement('div');
	oDiv.innerHTML=''
	oDiv.id = this.idpre +'_volume';
    oDiv.style.cssText = 'z-index:90;color:#fff; background-color:#f09;'
        +'height:'+window.innerHeight+'px ;width:36px;position:absolute;right:0px;bottom:0px;;font-size:16px;margin-bottom:0px;'
		+'overflow:hidden;display:none;'
        +' border-radius: 5px;filter: alpha(opacity = 90);opacity: 0.9; '
		var body=document.getElementsByTagName('body')[0];
       try{body.insertBefore(oDiv,body.childNodes[0]);	}catch(e){ } 
	   
	   var that = this ;
	  window.addEventListener('resize', function () {
		        
                try {
                    document.getElementById( that.idpre+'_volume').style.height =  window.innerHeight + 'px';
                }catch (e){console.warn(e)}
     }, false)
	  
	  window.ev=window.event||arguments.callee.caller.arguments[0];
	   window.addEventListener( 'keydown',function(ev){return false;},false);
	  window.addEventListener( 'keyup',function(ev){
		
		var event= ev ;
	 
	 
       // mkTrace(event.keyCode+':'+ String.fromCharCode(event.keyCode))
	     if(event.keyCode===38  || event.keyCode===40 || event.keyCode===77){
			 try { 
			  var vheight = parseInt(  parseInt(oPlayer.player().volume*10000)/10000  * window.innerHeight );
			 
		      document.getElementById( that.idpre+'_volume').style.height = vheight + 'px';
			  document.getElementById( that.idpre+'_volume').style.display = 'block';
			  document.getElementById( that.idpre+'_volume').innerHTML = parseInt(oPlayer.player().volume*100)/100 ;
			   
			   oPlayer.player().muted ? document.getElementById( that.idpre+'_volume').style.backgroundColor ='#888' :document.getElementById( that.idpre+'_volume').style.backgroundColor ='#f09'  ;
			   
			  
			  if(that.lockDisplay == false || true){
				  that.lockDisplay = true;
			 
				  that.cbfunctionname = that.timeoutCallBack.__$bind$__(that);
				 window.clearTimeout( window.timer  )   
			     window.timer = window.setTimeout( that.cbfunctionname ,5000)
				 
			  }
		     }catch (e){console.warn(e)}
	     }
		 
	 return false;
	},false);
	
	
	
}
 
TOOLS.ready(function(){	
    
 
   /*  window.pv = new plug_volume.mkVolDiv('g_');	  
	  window.setTimeout(function(){
	 window.pv.run();			
	  },2000)*/
 
	
	
	
})